function formatterBar(t, e) {
    var r = (100 * +e[t.dataIndex].rate).toFixed(1);
    return "".concat(t.value, "人，").concat(r, "%");
}

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.lineChartType = exports.barChartType = exports.pieChartType = void 0;

var pieChartType = {
    clientfavrate: {
        config: {},
        handle: function(e) {
            [ "viewmemberrate", "viewproductrate", "viewsiterate" ].forEach(function(t) {
                e[t] = (100 * e[t]).toFixed(2);
            });
        }
    },
    genderrate: {
        config: {
            option: {
                color: [ "#41afff", "#f9bd00", "#3bbb00" ]
            },
            title: {
                text: "性别分布"
            },
            legend: {
                data: [ "男", "女", "未知" ]
            },
            labelNormal: {},
            series: {}
        },
        handle: function(e, t) {
            var r = [ "men", "women", "unknown" ].map(function(t) {
                return e[t];
            }), a = t.legend.data;
            t.labelNormal.formatter = function(t) {
                return formatterBar(t, r);
            }, t.series.data = r.map(function(t, e) {
                return {
                    value: t.total,
                    name: a[e]
                };
            });
        }
    }
};

exports.pieChartType = pieChartType;

var barChartType = {
    clientmutual: {
        config: {},
        handle: function(e) {
            return [ "callphonetotal", "transfertotal", "savephonetotal", "contacttotal", "liketotal" ].map(function(t) {
                return e[t];
            });
        }
    },
    visitorfrom: {
        config: {
            title: {
                text: "访客来源分析"
            },
            grid: {
                left: 15,
                right: 80
            },
            yAxis: {
                data: [ "主动搜索", "转发分享", "扫码进入" ]
            },
            labelNormal: {}
        },
        handle: function(e, t) {
            var r = [ "other", "transfer", "qrcode" ].map(function(t) {
                return e[t];
            });
            return t.labelNormal.formatter = function(t) {
                return formatterBar(t, r);
            }, r.map(function(t) {
                return t.total;
            });
        }
    },
    area: {
        config: {
            title: {
                text: "地区分布TOP10"
            },
            grid: {
                left: 15,
                right: 80
            },
            yAxis: {
                data: []
            },
            labelNormal: {}
        },
        handle: function(t, e) {
            var r = t.slice(0, 10).reverse();
            return e.yAxis.data = r.map(function(t) {
                return t.name;
            }), e.labelNormal.formatter = function(t) {
                return formatterBar(t, r);
            }, r.map(function(t) {
                return t.total;
            });
        }
    },
    visitor: {
        config: {
            title: {
                show: !1
            },
            grid: {
                left: 15,
                top: 10
            },
            yAxis: {
                data: [ "复制邮箱", "复制微信", "拨打电话", "播放语音", "访问官网", "转发名片", "查看名片" ]
            }
        },
        handle: function(e) {
            return [ "copyemail", "copywechat", "call", "voice", "viewsite", "share", "timeviewcard" ].map(function(t) {
                return e[t];
            });
        }
    }
};

exports.barChartType = barChartType;

var lineChartType = {
    recenttrends: {
        config: {},
        handle: function() {}
    },
    nicherecenttrends: {
        config: {
            title: {
                text: "近15日客户活跃度",
                show: !0
            },
            grid: {
                top: "20%"
            }
        },
        handle: function() {}
    }
};

exports.lineChartType = lineChartType;